﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GeodeticDistance.Models;

namespace GeodeticDistance.Controllers
{
    public class DistanceController : Controller
    {
        [HttpGet]
        public ActionResult ChooseCities()
        {
            // ViewBag.StudyMode = new SelectList(Student.StudyModes);
            ViewBag.Country = new SelectList(CityData.Countries);
            ViewBag.City = new SelectList(CityData.Cities);
            return View();                                                          // strongly typed view, don't need though to pass in a student object
        }

        [HttpPost]
        public ActionResult ChooseCities(CityLocation c1)
        {
            if (ModelState.IsValid)
            {
                //student.StudyMode = StudyMode;                      // full-time or part-time etc.
                return RedirectToAction("Confirm", c1);
            }
            else
            {
                return View();
            }
        }

        // display details of the student just registered
        public ActionResult Confirm(CityLocation c1)
        {
            return View(c1);
        }

    }
}
